package com.oceansoft.mobile.biz.admin.service;

import java.util.ArrayList;
import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.oceansoft.mobile.biz.admin.entity.Wxjq;
import com.oceansoft.mobile.biz.admin.entity.WxjqMapper;
import com.oceansoft.mobile.common.base.entity.Pager;
import com.oceansoft.mobile.common.base.entity.Query;
import com.oceansoft.mobile.common.dao.ICommonDao;

/**
 * 微信集群服务实现类
 * @author Administrator
 *
 */
@Service
public class WxjqServiceImpl implements IWxjqService {
	 @Resource
	    private ICommonDao commonDao;

	@Override
	public Pager<Wxjq> loadWxjqByPage(String title,Query query) {
		String page_sql = String.format(
				"SELECT t.* FROM t_wxjq t WHERE T.title like ? %s",
				Query.getPageSQL("T", query));
		String count_sql = String.format(
				"SELECT COUNT(*) FROM t_wxjq T WHERE T.title like ? %s",
				Query.getCountSQL("T", query));
		List<Wxjq> list = new ArrayList<Wxjq>();
		list = commonDao.loadList(page_sql, new WxjqMapper(),"%"+title+"%");
		int total = commonDao.getCount(count_sql,"%"+title+"%");
		return new Pager<Wxjq>(total, query.getPage(), list);
	}
	
	@Override
	public Wxjq loadWxjqById(long sid) {
		return null;
	}
	 
	 
}
